package appapi.Vo;

import appapi.entity.basic.SysConfigEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import org.springframework.beans.BeanUtils;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 请求对象
 *
 * @author luocheng
 * @version 1.0
 * @date 2023/05/27 16:07
 */
@ApiModel
@Data
@NoArgsConstructor
public class EditSysConfigVo implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "设置ID", required = true)
    @NotNull(message = "设置ID不能为空")
    private Integer confId;

    @ApiModelProperty(value = "设备编码规则", required = true)
    @NotNull(message = "设备编码规则不能为空")
    private String confEquip;

    @ApiModelProperty(value = "月检预警日期", required = true)
    @NotNull(message = "月检预警日期不能为空")
    private Integer confAlarmdate;

    @ApiModelProperty(value = "自检提示内容", required = true)
    @NotNull(message = "自检提示内容不能为空")
    private String confSelfmsg;

    @ApiModelProperty(value = "自检提示时长（S）", required = true)
    @NotNull(message = "自检提示时长不能为空")
    private String confNoticetime;


    public SysConfigEntity vo2Entity(){
        SysConfigEntity entity = new SysConfigEntity();
        BeanUtils.copyProperties(this,entity);
        return entity;
    }
}
